package org.example.demo;

import org.junit.jupiter.api.Test;

import java.util.LinkedList;
import java.util.Queue;

/**
 * @Email: jixiaotian.ch@foxmail.com
 * @Date : 2020/9/23 18:03
 */
public class DemoTest {

    public static void main(String[] args) {
        Queue<String> msg = new LinkedList<>();
        int maxSize = 5;

        Producer producer = new Producer(msg, maxSize);
        Consumers consumers = new Consumers(msg, maxSize);

        Thread t1 = new Thread(producer);
        Thread t2 = new Thread(consumers);

        t1.start();
        t2.start();
    }

    @Test
    public void PCTest() {

        Queue<String> msg = new LinkedList<>();
        int maxSize = 8;

        Producer producer = new Producer(msg, maxSize);
        Consumers consumers = new Consumers(msg, maxSize);

        Thread t1 = new Thread(producer);
        Thread t2 = new Thread(consumers);

        t1.start();
        t2.start();

    }
}
